<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <title>Document</title>
    <script src="/lib/vue.js"></script>
  </head>
  <body>
    <div id="app">Hello Vue</div>
    <script>
      var app = document.getElementById("app");
      var obj = {};
      Object.defineProperty(obj, "myname", {
        set(value) {
          console.log("有人修改了", value);
          app.innerHTML = value;
        },
        get() {
          console.log("有人访问了", app.innerHTML);
        },
      });
    </script>
  </body>
</html>
